<template>
  <div class="form-container">
    <div class="login-box">
      <div class="login-title"><span>找回密码</span></div>
      <form action="#" method="post">
        <div class="form-group">
          <input type="text" class="form-input" name="username" placeholder="请输入电子邮箱" id="email" />
        </div>
        <div class="form-group password-group">
          <input type="password" class="form-input" placeholder="密码为6-18个非空白字符" name="password" id="userPwd" />
        </div>
        <div class="form-group password-group">
          <input type="password" class="form-input" placeholder="确认密码必须与密码相同" name="password" id="cPwd" />
        </div>
        <div>
          <input type="text" class="form-input" placeholder="验证码" style="padding-right: 200px;box-sizing: border-box;" id="codes" />
          <span style="float:right;position: relative;bottom:36px;margin-right: 10px;line-height: 36px;">
            <a href="javascript:void(0)" id="sendMail">发送邮件验证码</a>
            <span id="counter"></span>
          </span>
        </div>
        <div class="form-group">
          <input type="button" class="action-btn" value="注册" id="regBtn">
        </div>
        <div class="form-footer">
          <span style="color: #adadad;">已有帐号</span>
          <a href="javascript:void(0)" @click="$emit('show-modal', 1)">登录</a>
          <a href="javascript:void(0)" @click="$emit('show-modal', 2)">注册</a>
        </div>
        <div style="text-align: center;font-size: 13px;">
          <span id="message" style="display:none"></span>
        </div>
      </form>
    </div>
  </div>
</template>

<script setup>
// 这里可以添加表单验证、提交等交互逻辑
</script>

<style scoped>
.form-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 450px;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.login-title {
  padding: 20px;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

form {
  padding: 25px;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-input {
  min-width: 360px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: #007BFF;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.password-group {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 5px;
}

.action-btn {
  width: 100%;
  padding: 12px;
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.action-btn:hover {
  background-color: #0056b3;
}

.form-footer {
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
}

.form-footer a {
  color: #007BFF;
  text-decoration: none;
  margin: 0 5px;
}

.form-footer a:hover {
  text-decoration: underline;
}

#counter {
  font-size: 12px;
  color: rgba(0, 0, 255, 0.5);
  font-weight: lighter;
  display: none;
}
</style>